// TOWN DIALOGUE SCRIPT
//    Town 13: Aries

// This is the dialogue for this town.
// You can use states numbered from 1 to 99.

begintalkscript;

variables;

short choice;

// *** Guards at inn ***
begintalknode 1;
	state = -1;
	personality = -1;
	nextstate = -1;
	condition = 1;
	question = "Guard";
	text1 = "The guard looks up from the game he's enjoying and gives you an icy stare.";
	text2 = "_I'm playing a game here._";
	text3 = "_I don't know anything and just wish to play the game._";
	text4 = "_Hey, I'm busy playing here._";
	text5 = "He then ignores you and goes back to figuring out his next move.";
	text6 = "_Move along now buddy if you know what's good for you._";
	action = END_TALK;
	code =
		clear_strings();
		add_string(1);
		add_string(get_ran(1, 2, 6));
	break;

// *** Terra ***
begintalknode 5;
	state = -1;
	personality = 1306;
	nextstate = 6;
	condition = 1;
	question = "Terra";
	text1 = "A pretty blond woman looks at you as you enter her house.";
	text2 = "She doesn't seem worried, but looks a little annoyed.";
	text3 = "_My name is Terra.  What do you want?_ she asks.";
	text5 = "Terra stops what she is doing to look up at you.";
	text6 = "_Hello again, what do you want?_ she asks.";
	text7 = "_Have you completed my task yet?_ she adds.";
	text8 = "_How is Demonslayer working for you?_ she adds.";
	action = INTRO;
	code =
		remove_string(7);
		remove_string(8);
		if ((get_flag(50, 10) > 0) && (get_flag(50, 11) == 0) && (get_flag(50, 12) == 0)) {
			add_string(7);
		}
		if ((get_flag(50, 12) > 0) && (get_flag(50, 13) == 0)) {
			add_string(7);
		}
		if ((get_flag(50, 13) > 0) && (get_flag(13, 3) > 0)) {
			add_string(8);
		}
	break;

begintalknode 6;
	state = 6;
	personality = 1306;
	nextstate = -1;
	condition = get_flag(13, 2) == 0;
	question = "What do you do?";
	text1 = "She considers your question, then answers _I heal those in need here in Aries._";
	text2 = "_It will run you 35 coins to heal a member of your party._ she adds.";
	text3 = "_Do you need healing?_ she asks.";
	code =
		set_flag(13, 2, 1);
	break;

begintalknode 7;
	state = 6;
	personality = 1306;
	nextstate = -1;
	condition = get_flag(13, 2) > 0;
	question = "I need some healing (pay 35 coins).";
	text1 = "Terra says _I am sorry, but you do not have the coins required for me to perform any healing for you._";
	text3 = "_Come back when you do need healing._ Terra says.";
	text5 = "Terra places her hands on your shoulders looking deep in your eyes.  You feel a little weak, but then feel all of your health and strength return.";
	code =
		clear_strings();
		if (coins_amount() < 35)
			add_string(1);
		else if (run_select_a_pc(1) == 0)
			add_string(3);
		else {
			play_sound(24);
			add_string(5);
			restore_pc(get_selected_pc());
			change_coins(-35);
		}
	break;

begintalknode 8;
	state = 6;
	personality = 1306;
	nextstate = 15;
	condition = get_flag(50, 10) == 0;
	question = "Do you know where Demonslayer is?";
	text1 = "Terra looks a little startled about the question.";
	text2 = "She looks carefully at you before replying.";
	text3 = "_I know about the weapon you are asking about, but before I can tell you about it, I need you to do some things for me._";
	text4 = "_Are you agreeable?_ she asks.";

begintalknode 9;
	state = 6;
	personality = 1306;
	nextstate = -1;
	condition = (get_flag(50, 10) > 0) && (get_flag(50, 12) == 0) && (has_special_item(7) > 0);
	question = "I have not delivered the potion yet.";
	text1 = "Terra sighs _Please deliver it as soon as possible._";

begintalknode 10;
	state = 6;
	personality = 1306;
	nextstate = -1;
	condition = (get_flag(50, 10) > 0) && (get_flag(50, 11) == 0) && (get_flag(50, 12) == 0) && (has_special_item(7) == 0);
	question = "I've delivered the potion.";
	text1 = "Terra thanks you and hands you some coins.";
	text2 = "_Before I answer your question about the weapon, I need you to do something else for me._";
	code =
		set_flag(50, 11, 1);
		toggle_quest(5, 0);
		play_sound(39);
		pay_coins(75);
		award_party_xp(20, 15);
	break;

begintalknode 11;
	state = 6;
	personality = 1306;
	nextstate = 17;
	condition = (get_flag(50, 11) > 0) && (get_flag(50, 12) == 0);
	question = "What else do you need from us?";
	text1 = "Terra replies _I need a certain herb to finish a special potion I'm working on._";
	text2 = "_I need a sprig of parsley._";
	text3 = "_I cannot grow that here, but I've heard that there may be some in a cave northwest of here._";
	text4 = "_I'll tell you know what you need about Demonslayer if you bring me a sprig of parsley._";
	text5 = "_Are you game?_ she asks.";

begintalknode 12;
	state = 6;
	personality = 1306;
	nextstate = -1;
	condition = (get_flag(50, 12) > 0) && (get_flag(50, 13) == 0) && (has_special_item(8) == 0);
	question = "I have not found the parsley yet.";
	text1 = "Terra sighs _I really need that, so please return once you have found some._";
	text2 = "_Remember, I believe I heard that there may be some in a cave to the northwest of here._";

begintalknode 13;
	state = 6;
	personality = 1306;
	nextstate = -1;
	condition = (get_flag(50, 12) > 0) && (get_flag(50, 13) == 0) && (has_special_item(8) > 0);
	question = "I have your parsley.";
	text1 = "Terra smiles broadly _Thank you, this is just what I need._ she says as she takes it from you.";
	text2 = "She hands you a few coins _Please take these for your efforts also._";
	code =
		take_special_item(8);
		set_flag(50, 13, 1);
		toggle_quest(6, 0);
		play_sound(39);
		pay_coins(100);
		award_party_xp(20, 15);
	break;

begintalknode 14;
	state = 6;
	personality = 1306;
	nextstate = -1;
	condition = (get_flag(50, 13) > 0) && (get_flag(13, 3) == 0);
	question = "What do you know about Demonslayer?";
	text1 = "Terra answers _I did promise you information if you completed some tasks for me, didn't I._";
	text2 = "_I have Demonslayer, and since you seem to be good people, I'll let you use it._";
	text3 = "With that, she pulls out the ornate weapon and gives it to you.";
	text4 = "_Take good care of her_ Terra says.";
	code =
		set_flag(13, 3, 1);
		reward_give(450);
	break;

begintalknode 15;
	state = 15;
	personality = 1306;
	nextstate = -1;
	condition = 1;
	question = "Yes.";
	text1 = "Terra smiles _Thanks, please take this potion to a farmer east of town._";
	text2 = "_He has an strange disease that this potion should cure._";
	text3 = "_Come back after you've delivered it._ she adds.";
	action = END_TALK;
	code =
		set_flag(50, 10, 1);
		toggle_quest(5, 1);
		change_spec_item(7, 1);
	break;

begintalknode 16;
	state = 15;
	personality = 1306;
	nextstate = -1;
	condition = 1;
	question = "No, I'm not a delivery person.";
	text1 = "Terra looks at you like you are dung _Suit yourself._ she snorts.";
	text2 = "_Of course you won't learn anything about Demonslayer with that attitude._";
	action = END_TALK;

begintalknode 17;
	state = 17;
	personality = 1306;
	nextstate = -1;
	condition = 1;
	question = "Yes.";
	text1 = "Terra starts grinning _I knew you guys were game._";
	text2 = "_Come back to me after you have found some._ she adds.";
	action = END_TALK;
	code =
		set_flag(50, 12, 1);
		toggle_quest(6, 1);
	break;

begintalknode 18;
	state = 17;
	personality = 1306;
	nextstate = -1;
	condition = 1;
	question = "No, I don't have time for this.";
	text1 = "Terra seems a little a taken back _OK._ she says.";
	text2 = "_Of course you won't learn anything about Demonslayer with that attitude._";
	action = END_TALK;

// *** Tahlatei ***
begintalknode 25;
	state = -1;
	personality = 1307;
	nextstate = 26;
	condition = 1;
	question = "Tahlatei";
	text1 = "The creature behind the counter is a real oddity to you.";
	text2 = "You've heard of them, but have never seen one live, a Vahnatai!";
	text3 = "He speaks _Welcome surface dwellers, I am Tahlatei._";
	text4 = "_Let me know if you have any questions or wish to buy something._";
	text5 = "Tahlatei gazes at you from behind the counter _Welcome again surface dwellers._";
	text6 = "_Please feel free to browse the fine selection of items I have available._";
	action = INTRO;

begintalknode 26;
	state = 26;
	personality = 1307;
	nextstate = -1;
	condition = 1;
	question = "What do you do?";
	text1 = "Tahlatei gives what appears to be a smile _I sell fine Vahnatai items to travelers such as yourself._";
	text2 = "_Can I show you the selection of items available?_";

begintalknode 27;
	state = 26;
	personality = 1307;
	nextstate = -1;
	condition = 1;
	question = "Where did you come from?";
	text1 = "Tahlatei gives what you assume is a laugh _Why from farther below._";
	text2 = "_I couldn't make a go there, so decided to try my hand with the upperworlders._";
	text3 = "_Can I interest you in some fine Vahnatai goods?_";

begintalknode 28;
	state = 26;
	personality = 1307;
	nextstate = -1;
	condition = 1;
	question = "You speak the language very well.";
	text1 = "Tahlatei replies _Thank you.  I found it's more profitable to be able to communicate with customers._";
	text2 = "_Of course, it took a while to achieve, but worth it in the long run._";
	text3 = "_Would you like to look at some the Vahnatai items that are available?_ he asks.";

begintalknode 29;
	state = 26;
	personality = 1307;
	nextstate = -1;
	condition = 1;
	question = "Can I look at the Vahnatai products?";
	text1 = "You finish shopping the trove.";
	code =
		begin_shop_mode("Vahnatai Trove", "Tahlatei sells many fine Vahnatai pieces to the explorering public.  Prices are high.", 19, 4, 3);
	break;

// *** Purrly ***
begintalknode 35;
	state = -1;
	personality = 1317;
	nextstate = 36;
	condition = 1;
	question = "Purrly";
	text1 = "Standing behind the counter appears to be a large cat.";
	text2 = "You recognize it as a nephil, another of the races that live in Avernum.";
	text3 = "The nephil purrs at you _Welcome, I'm Purrly._";
	text5 = "Purrly seems happy to see you again.";
	text6 = "_Hello, can I interest you in some clothes?_";
	action = INTRO;

begintalknode 36;
	state = 36;
	personality = 1317;
	nextstate = -1;
	condition = 1;
	question = "What do you do?";
	text1 = "Purrly answers, somewhat happily _I run the clothing store here in Aries._";
	text2 = "_I provide a fine selection of clothes to those in need._";

begintalknode 37;
	state = 36;
	personality = 1317;
	nextstate = 39;
	condition = get_flag(13, 4) == 0;
	question = "Do I address you as miss or mr?";
	text1 = "Purrly seems a little hurt by the question _I am a female, could you not tell?_";
	text2 = "This is the second time you've made this mistake.";
	code =
		set_flag(13, 4, 1);
		remove_string(2);
		if (get_flag(13, 5) > 0)
			add_string(2);
	break;

begintalknode 38;
	state = 36;
	personality = 1317;
	nextstate = -1;
	condition = 1;
	question = "Can I see your clothes?";
	text1 = "You finish looking at clothes.";
	code =
		begin_shop_mode("Aries Fashions", "Purrly provides clothes to those in need of such.  Prices are high.", 20, 4, 3);
	break;

begintalknode 39;
	state = 39;
	personality = 1317;
	nextstate = -1;
	condition = 1;
	question = "I'm sorry.";
	text1 = "Purrly looks appeased and happy.";
	text2 = "She purrs _Thank you._";
	text3 = "You're hoping that the look she's giving you is not one of romantic interest...";

// *** Walten ***
begintalknode 40;
	state = -1;
	personality = 1318;
	nextstate = 41;
	condition = 1;
	question = "Walten";
	text1 = "A strong man is busy working items within the Forge.";
	text2 = "He looks up as you approach _Hello surface dwellers, I'm Walten.";
	text3 = "_Can I interest you in some fine metal armor or weapons?_";
	text5 = "Walten stops and shakes your hand _Welcome again._";
	text6 = "_Come back for some more armament have you?_";
	action = INTRO;

begintalknode 41;
	state = 41;
	personality = 1318;
	nextstate = -1;
	condition = 1;
	question = "What do you do?";
	text1 = "Walten says _You must not be a 10 percenter to ask such a question._";
	text2 = "He points around the forge _What do you think I do?_";

begintalknode 42;
	state = 41;
	personality = 1318;
	nextstate = -1;
	condition = 1;
	question = "Can I see your forge goods?";
	text1 = "You finish shopping.";
	code =
		begin_shop_mode("Aries Forge", "Walten has many fine pieces of forged items available for sale.  Prices are high.", 21, 4, 3);
	break;

// *** ssLizzy ***
begintalknode 45;
	state = -1;
	personality = 1319;
	nextstate = 46;
	condition = 1;
	question = "ssLizzy";
	text1 = "Standing behind the counter is what appears to be a large lizard.";
	text2 = "It starts talking, surprising you somewhat.";
	text3 = "_Hellos travelerss.  My names iss ssLizzy._";
	text5 = "ssLizzy swivels around to face you _Welcomes agains._";
	text6 = "_Iss theres ssomething I cans gets you?_";
	action = INTRO;

begintalknode 46;
	state = 46;
	personality = 1319;
	nextstate = -1;
	condition = 1;
	question = "What do you do?";
	text1 = "ssLizzy answers _I provides a sselection ofss fine treassuress for ssale._";
	text2 = "_Cans I ssshow youss my inventory?_";

begintalknode 47;
	state = 46;
	personality = 1319;
	nextstate = 49;
	condition = get_flag(13, 5) == 0;
	question = "Do I address you as miss or mr?";
	text1 = "ssLizzy looks a little upset _Youss may addressess me asss missss._";
	text2 = "This is the second time you've made this mistake.";
	code =
		set_flag(13, 5, 1);
		remove_string(2);
		if (get_flag(13, 4) > 0)
			add_string(2);
	break;

begintalknode 48;
	state = 46;
	personality = 1319;
	nextstate = -1;
	condition = 1;
	question = "Can I look through your stuff?";
	text1 = "You finish shopping the random treasures.";
	code =
		begin_shop_mode("Miscellaneous Treasures", "ssLizzy has many unique items available.  Prices are extra high.", 22, 5, 3);
	break;

begintalknode 49;
	state = 49;
	personality = 1319;
	nextstate = -1;
	condition = 1;
	question = "I'm sorry.";
	text1 = "ssLizzy seems happy with the response.";
	text2 = "ssLizzy flicks her tongue _sThatsss OK._";
	text3 = "You're hoping the look of interest and tongue flicking in your direction isn't the start of romantic feelings.";

// *** Mayor Johnson ***
begintalknode 50;
	state = -1;
	personality = 1320;
	nextstate = 51;
	condition = 1;
	question = "Mayor Johnson";
	text1 = "A large, official looking man is sitting behind the desk.";
	text2 = "He looks up from some paperwork and extends his hand.";
	text3 = "_Hello surface dwellers._ he says shaking your hand _I am Mayor Johnson._";
	text4 = "_What can I do for you?_";
	text5 = "Mayor Johnson stops what he is working on to greet you.";
	text6 = "_We meet again._ he says _What can I help you with?_";
	action = INTRO;

begintalknode 51;
	state = 51;
	personality = 1320;
	nextstate = -1;
	condition = 1;
	question = "What do you do?";
	text1 = "Mayor Johnson laughs _Why I'm the mayor of Aries._";
	text2 = "_Basically, I just ensure that things are running smoothly here._";
	text3 = "_I also ensure that the area around Aries and the path to the rest of Avernum is safe._";
	text4 = "_Still pretty wild to the east of here, though some have made a go of it._";
	text5 = "He adds _We don't see too many people from the surface down here, are you looking for something?_";

begintalknode 52;
	state = 51;
	personality = 1320;
	nextstate = 53;
	condition = 1;
	question = "Do you know a person named Terra?";
	text1 = "Mayor Johnson says _Of course, a fine upstanding citizen._";
	text2 = "_She lives in the house in the southeast corner of town._";
	text3 = "_Why do you ask?_";

begintalknode 53;
	state = 53;
	personality = 1320;
	nextstate = -1;
	condition = 1;
	question = "Explain quest.";
	text1 = "Mayor Johnson says _Sounds exciting._";
	text2 = "_Good luck with your quest._";
	text3 = "He appears as if you are keeping him from paperwork.";

// *** Jack ***
begintalknode 55;
	state = -1;
	personality = 1324;
	nextstate = 56;
	condition = 1;
	question = "Jack";
	text1 = "A tall, rugged man is busy wiping up the counter as you walk up.";
	text2 = "He pauses to welcome you _Hello travelers, I'm Jack.  Welcome to my inn._";
	text5 = "Jack seems happy to see you _Welcome again travelers._";
	text6 = "_Can I get you something to drink or perhaps a room?_";
	action = INTRO;

begintalknode 56;
	state = 56;
	personality = 1324;
	nextstate = -1;
	condition = 1;
	question = "What do you do?";
	text1 = "Jack gives a hearty chuckle _Why I manage the inn here in Aries._";
	text2 = "_I provide clean rooms for travelers who need rest, rooms are 50 coins a night._";
	text3 = "_And I serve drinks for those who are thirsty, beer is 2 coins._";
	text4 = "_What can I get you?_ Jack asks.";

begintalknode 57;
	state = 56;
	personality = 1324;
	nextstate = -1;
	condition = 1;
	question = "What do you know about Demonslayer.";
	text1 = "Jack thinks for a moment _I thought I remembered something about that, but don't._";
	text2 = "_Sorry can't help you there.  Can I get you a drink?_";

begintalknode 58;
	state = 56;
	personality = 1324;
	nextstate = -1;
	condition = 1;
	question = "I'd like a room please (50 coins).";
	text1 = "Jack takes your money and shows you to a nice, clean room.";
	text2 = "You get some needed rest, awaking refreshed and ready to go.";
	text3 = "Jack looks at the pittance you are trying to pay.";
	text4 = "_You can not afford the room, come back when you have 50 coins._";
	text5 = "Jack remarks _You need to tie up your horse outside, it cannot stay in the room with you._";
	action = INN 50 30 9;

begintalknode 59;
	state = 56;
	personality = 1324;
	nextstate = -1;
	condition = 1;
	question = "I'd like a drink please.";
	text1 = "Jack takes your 2 coins, draws a cold beer and sits it in front of you.";
	text2 = "Boy that sure goes down smooth.";
	text3 = "_Well, suit yourself.  Let me know if you want a drink later._ Jack adds.";
	text4 = "Jack grins _You need 2 coins first before I can serve you._";
	text5 = "Jack says _You are too drunk for me to serve.  Go sleep it off first._";
	code =
		clear_strings();
		if (coins_amount() < 2)
			add_string(4);
		else if (run_select_a_pc(1) == 0)
			add_string(3);
		else {
			if (get_char_status(get_selected_pc(), 28) >= 20) {
				add_string(5);
			}
			else {
				play_sound(24);
				add_string(1);
				add_string(2);
				change_coins(-2);
				// make drunk
				set_char_status(get_selected_pc(), 28, 2, 1, 0);
			}
		}
	break;
